///////////////////////////////////YUNYOO.CN//////////////////////////////////////
//                                                                               *
// This file is part of A64Dbg and VMPStudio gui frontend project.               *
//                                                                               *
// Copyright(C) 2021 YunYoo Corp., ALL RIGHTS RESERVED.                          *
//                                                                               *
// Internet: yunyoo.cn                                                           *
//                                                                               *
// This code is distributed "as is", part of YUNYOO.CN and without warranty of   *
// any kind, expressed or implied, including, but not limited to warranty of     *
// fitness for any particular purpose. In no event will YUNYOO.CN be liable to   *
// you for any special, incidental, indirect, consequential or any other         *
// damages caused by the use, misuse, or the inability to use of this code,      *
// including anylost profits or lost savings, even if YUNYOO.CN has been advised *
// of the possibility of such damages.                                           *
//                                                                               *
///////////////////////////////////////*//////////////////////////////////////////


#pragma once

enum hypertrace_type_t {
    HTT_FUNCTION,
    HTT_OBJC,
    HTT_SYSCALL,
    HTT_HTTP2,
};

struct hypertrace_buffer_t {
  unsigned int size;
  unsigned int boff;
  char buff[0];
};

struct hypertrace_callinfo_t {
  unsigned long long retaddr;
  unsigned long long args[8];
  unsigned int hitcount;
  unsigned int reserved;
};

struct hypertrace_objcinfo_t : public hypertrace_callinfo_t {
  hypertrace_buffer_t classname;
  hypertrace_buffer_t selname;
};

struct hypertrace_syscall_t : public hypertrace_callinfo_t {
  int sysno;
};

struct hypertrace_payload_t {
  union {
    hypertrace_type_t type;
    unsigned long long header;
  };
  union {
    hypertrace_callinfo_t func;
    hypertrace_objcinfo_t objc;
    hypertrace_syscall_t syscall;
    hypertrace_buffer_t buffer;
  };	
};

